CREATE TABLE [dbo].[DnnProduct_SearchItemWord]
(
[SearchItemWordID] [int] NOT NULL IDENTITY(1, 1),
[SearchItemID] [int] NOT NULL,
[SearchWordsID] [int] NOT NULL,
[Occurrences] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_SearchItemWord] ADD CONSTRAINT [PK_DnnProduct_SearchItemWords] PRIMARY KEY CLUSTERED  ([SearchItemWordID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_SearchItemWord] ADD CONSTRAINT [IX_DnnProduct_SearchItemWord] UNIQUE NONCLUSTERED  ([SearchItemID], [SearchWordsID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_SearchItemWord] ADD CONSTRAINT [FK_DnnProduct_SearchItemWord_DnnProduct_SearchItem] FOREIGN KEY ([SearchItemID]) REFERENCES [dbo].[DnnProduct_SearchItem] ([SearchItemID]) ON DELETE CASCADE ON UPDATE CASCADE
GO
ALTER TABLE [dbo].[DnnProduct_SearchItemWord] WITH NOCHECK ADD CONSTRAINT [FK_DnnProduct_SearchItemWord_DnnProduct_SearchWord] FOREIGN KEY ([SearchWordsID]) REFERENCES [dbo].[DnnProduct_SearchWord] ([SearchWordsID]) ON DELETE CASCADE ON UPDATE CASCADE
GO
